Drilling fluids are used in the drilling of subterranean oil and gas wells. In rotary drilling, drilling fluids, also known as “drilling muds,” or simply “muds” due to a high solids content, are used for cooling and lubricating drill bits, lubricating drill pipes, carrying cuttings and other materials from a borehole to the surface of the earth, and exerting a hydrostatic pressure against the borehole wall to prevent the flow of fluids from the surrounding formation into the borehole. However, drilling fluids can become contaminated by compounds encountered during drilling operations.
For example, gases commonly encountered in subterranean formations include methane (CH4), carbon dioxide (CO2), carbon monoxide (CO), nitrogen (N2), ammonia (NH3), and hydrogen sulfide (H2S), which may be dissolved within fluids within the subterranean formation. Some of the gases have negative effects on drill string components, and may impose additional costs in conducting drilling operations in such environments. For example, H2S is toxic, flammable, and corrosive. In certain concentrations, and over time, CO2 may be corrosive to processing equipment by reacting with steel.
In addition to drilling fluids, other fluids within the wellbore, such as stimulation fluids, workover fluids, production fluids, etc., may include corrosive gases or other materials that may induce corrosion or otherwise damage the downhole equipment.
Conventional methods of measuring a concentration of such detrimental components within the wellbore include obtaining samples of the fluids within the wellbore and analyzing the fluids at the surface. However, samples acquired at high-temperature and high-pressure (HPHT) conditions encountered downhole may not exhibit the same properties at the surface as they exhibit in the downhole environment. For example, laboratory analysis typically occurs after downhole samples have been flashed to room temperature and pressure conditions. The temperature and pressure reductions, however, cause precipitation of solids from the fluids, altering a pH of the sample. In addition, the temperature and pressure reductions may cause acidic gases such as CO2 and H2S to come out of solution, increasing a pH of the laboratory sample. Further, downhole samples that are analyzed at the surface may not be an accurate representation of the constituencies of fluids within particular zones of the subterranean formation. For example, fluids produced at the surface may be a mixture of fluids located within distinct zones of the subterranean formation and, therefore, may not be an accurate representation of the fluids located within distinct zones of the subterranean formation.